/*
 * @Author: Dorange.Wang
 * @Date: 2021-04-12 12:19:07
 * @LastEditors: your name
 * @LastEditTime: 2021-04-23 15:46:14
 * @Description: file content
 */
import { assign } from 'min-dash'
import paletteEntries from '../config/paletteEntries'
PaletteProvider.$inject = [
  'customPalette',
  'create',
  'elementFactory',
  'handTool',
  'lassoTool',
  'spaceTool',
  'globalConnect',
  'translate'
]

export default function PaletteProvider (
  customPalette,
  create,
  elementFactory,
  handTool,
  lassoTool,
  spaceTool,
  globalConnect,
  translate
) {
  this.create = create
  this.elementFactory = elementFactory
  this.handTool = handTool
  this.lassoTool = lassoTool
  this.spaceTool = spaceTool
  this.globalConnect = globalConnect
  this.translate = translate
  this._entries = paletteEntries(
    handTool,
    lassoTool,
    spaceTool,
    globalConnect
  )
  customPalette.registerProvider(this)
}

PaletteProvider.prototype.getPaletteEntries = function (element) {
  return this._entries
}
